import Mock from 'mockjs2'
import { builder } from '@/mock/util'
import data from '../mockData'

// const contract = () => {
//   return builder({
//     'list': data.contract,
//     'pageSize': 10,
//     'pageNum': 0,
//     'pages': 1,
//     'total': 2
//   })
// }
// const certificate = () => {
//   return builder({
//     'list': data.certificate,
//     'pageSize': 10,
//     'pageNum': 0,
//     'pages': 1,
//     'total': 2
//   })
// }
// const attachmentContract = () => {
//   return builder(data.contractAttachment)
// }
const attachmentCertificate = () => {
  return builder(data.certificateAttachment)
}
// const upload = () => {
//   return builder({
//     uid: Mock.mock('@integer(1, 999)'),
//     id: '123dzc',
//     attachmentName: 'aaabbb.doc',
//     attachmentUrl: 'blob:http://sadadasdsadsadfs.doc'
//   })
// }
const attachmentDelete = () => {
  return builder()
}
// Mock.mock(/\/contract/, 'post', contract)
// Mock.mock(/\/certificate/, 'post', certificate)
// Mock.mock(/\/attachment\/1\/1/, 'get', attachmentContract)
Mock.mock(/\/attachment\/2\/1/, 'get', attachmentCertificate)
// Mock.mock(/\/upload/, 'post', upload)
Mock.mock(/\/attachment/, 'delete', attachmentDelete)
